<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link href="css/reset.css" rel="stylesheet" type="text/css" />
<link href="css/gird.css" rel="stylesheet" type="text/css" />
<link href="css/usercenter.css" rel="stylesheet" type="text/css" />
</head>

<script src="../js/jquery_last.js" type="text/javascript"></script>
<link type="text/css" rel="stylesheet" href="../js/style/validator.css"></link>
<script src="../js/formValidator.js" type="text/javascript" charset="UTF-8"></script>
<script src="../js/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>
<script language="javascript" src="../js/DateTimeMask.js" type="text/javascript"></script>
<script defer="defer" src="../js/datepicker/WdatePicker.js" type="text/javascript"></script>

<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({formid:"form1",onerror:function(msg){alert(msg)},onsuccess:function(){return true;}});
	
	$("#number").formValidator({forcevalid:true,triggerevent:"change",onshow:"请输入台数",onfocus:"只能输入0-9之间的数字",oncorrect:"恭喜你,你输对了"}).inputValidator({min:1,type:"value",onerrormin:"你输入的值必须大于等于1",onerror:"只能输入0-9之间的数字，请确认"});//.defaultPassed();
	$("#device_name").formValidator({onshow:"请输入设备名称",onfocus:"请输入设备名称",oncorrect:"设备名称合法"}).inputValidator({min:1,empty:{leftempty:false,rightempty:false,emptyerror:"设备名称两边不能有空符号"},onerror:"设备名称不能为空,请确认"});
	$("#model").formValidator({onshow:"请输入型号",onfocus:"请输入型号",oncorrect:"型号合法"}).inputValidator({min:1,empty:{leftempty:false,rightempty:false,emptyerror:"型号两边不能有空符号"},onerror:"型号为空或位数不足或格式错误,请确认"});
	$("#factory").formValidator({onshow:"请输入生产厂家",onfocus:"请输入生产厂家",oncorrect:"生产厂家合法"}).inputValidator({min:1,empty:{leftempty:false,rightempty:false,emptyerror:"生产厂家两边不能有空符号"},onerror:"生产厂家不能为空,请确认"});
	$("#productivity").formValidator({onshow:"请输入年生产能力",onfocus:"请输入年生产能力",oncorrect:"年生产能力合法"}).inputValidator({min:1,empty:{leftempty:false,rightempty:false,emptyerror:"年生产能力两边不能有空符号"},onerror:"年生产能力不能为空,请确认"});    	
	$("#date").focus(function(){WdatePicker({skin:'whyGreen',oncleared:function(){$(this).blur();},onpicked:function(){$(this).blur();}})}).formValidator({onshow:"请输入投产时间",onfocus:"请输入投产时间",oncorrect:"你输入的日期合法"}).inputValidator({min:"1900-01-01",max:"2099-01-01",type:"date",onerror:"日期必须在\"1900-01-01\"和\"2099-01-01\"之间"});//.defaultPassed();
});

</script>
<body>
<div class="page">
  <div class="header">header</div>
  <div class="content">
    <div class="gird-s5c19">
      <div class="col-main">
        <h2>行业普查</h2>
        <ol class="progress step4">
          <li> 1.企业基本信息</a></li>
          <li>2.企业联系方式</a></li>
          <li >3.企业规模</a></li>
          <li  class="on">4.企业生产设备</a></li>
          <li>5.企业主要产品</a></li>
                  </ol>
        <h3>第四步，填写生产设备：</h3>
        <div class="input">
          <h4>已添加生产设备：</h4>
          <table width="100%" border="0" cellspacing="0" cellpadding="0" class="added">
            <tr>
              <th>设备名称</th>
              <th>台数</th>
              <th>型号</th>
              <th>生产厂家</th>
              <th>年生产能力</th>
              <th>投产时间</th>
              <th>运转情况</th>
              <th>操作</th>
            </tr>
            <s:iterator value="deviceList">
            <tr>
              <td><s:property value="device_name"/> </td>
              <td><s:property value="number"/></td>
              <td><s:property value="model"/></td>
              <td><s:property value="factory"/></td>
              <td><s:property value="productivity"/></td>
              <td><s:property value="date"/></td>
              <td><s:property value="operation"/></td>
              <td><a href="../indagate/indagateDeleteDevice.action?device_id=<s:property value='device_id'/>">删除</a></td>
            </tr>
            </s:iterator>
          </table>
          <form name="form1" id="form1" action="../indagate/indagateInsertDevice.action" method="post">
            <h4>添加生产设备：</h4>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <th width="120">设备名称：</th>
                <td width="240"><input name="companyDevice.device_name" type="text" id="device_name"/></td>
                <td><div id="device_nameTip"></div></td>
              </tr>
              <tr>
                <th>台数：</th>
                <td><input name="companyDevice.number" type="text" id="number"/></td>
                <td><div id="numberTip"></div>&nbsp;</td>
              </tr>
              <tr>
                <th>型号：</th>
                <td><input name="companyDevice.model" type="text" id="model"/></td>
                <td><div id="modelTip"></div>&nbsp;</td>
              </tr>
              <tr>
                <th>生产厂家：</th>
                <td><input name="companyDevice.factory" type="text" id="factory"/></td>
                <td><div id="factoryTip"></div>&nbsp;</td>
              </tr>
              <tr>
                <th>年生产能力：</th>
                <td><input name="companyDevice.productivity" type="text" id="productivity"/></td>
                <td><div id="productivityTip"></div>&nbsp;</td>
              </tr>
              <tr>
                <th width="120">投产时间：</th>
                <td width="240"><input name="companyDevice.date" type="text" id="date"/></td>
                <td><div id="dateTip"></div>&nbsp;</td>
              </tr>
              
              <tr>
                <th>运转情况：</th>
                <td>
                	<select name="companyDevice.operation" >
                		<option value="非常好">非常好</option>
                		<option value="良好">良好</option>
                		<option value="不佳">不佳</option>
                		<option value="损坏">损坏</option>
                	</select>
                </td>
                <td></td>
              </tr>
            </table>
            <button type="submit">添加设备</button>          
        </form>
        </div>
        <div class="btn">
          <button type="button" class="next" onclick="location='../indagate/toIndagateAdd5.action'">下一步，填写主要产品</button>
        </div>
      </div>
      <div class="col-sub">
        <div class="box">
          <div class="box-tp"></div>
          <div class="box-main">
            <h2>用户中心</h2>
            <ul>
              <li><a href="../user/getComRegState.action">申请企业会员</a></li>
              <li><a href="../user/webUserEdit.action">资料修改</a></li>
              <li><a href="../note/getNoteListByUser.action">我的消息</a></li>
              <li><a href="#">我要投稿</a></li>
              <li><a href="../user/UserLoginOut.action">退出</a></li>
            </ul>
          </div>
          <div class="box-bt"></div>
        </div>
      </div>
    </div>
  </div>
  <div class="footer"></div>
</div>
</body>
</html>

